<?php 
  include "inc/conn.php";
  $tts = date("YmdHis",time());
  $title = "搜索";
?>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes" />
<title><?php echo $title;?></title>
<meta name="author" content="andy - vip@d163.net">
<meta name="copyright" content="www.d163.net">
<link href="https://lib.baomitu.com/twitter-bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<link href="inc/css/wap2.css?v=<?php echo $tts;?>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="inc/js/ajax_wap.js?v=<?php echo $tts;?>"></script>
<body onLoad="inst();">
<div class="sub_bod"></div>
<div class="sub_top">
	<div class="title"><?php echo $title;?></div>
	<div class="back" id="pageback"><a href="?b=back" class="d">返回</a></div>
	<div class="menu" id="topmenus"><a href="###" class="d">推荐信息</a></div>
</div>
<div class="main">
<?php 

$stime=microtime(true); 
$codes = trim($_POST['code']);
$shujus = trim($_POST['txt_data']);
$shuru1 = trim($_POST['name']);
if($shujus != 1){
?>
  <form name="queryForm" method="post" class="" action="?t=<?php echo $tts; ?>" onsubmit="return startRequest(0);">
    <input type="hidden" name="txt_data" value="1">
    <div class="so_box" id="s11">
      <input name="name" type="text" class="txts" id="name" value="" placeholder="请输入<?php echo $tiaojian1;?>" onfocus="st('name',1)" onBlur="startRequest(2)" />
    </div>
    <?php if($ismas=="1"){ ?>
    <div class="so_box" id="s33">
      <input name="code" type="text" class="txts" id="code" placeholder="请输入验证码" onfocus="this.value=''" onBlur="startRequest(3)" />
      <div class="more" id="clearkey">
        <img src="inc/code.php?t=<?php echo date("Y-m-d-H-i-s",time());?>" id="Codes" onClick="this.src='inc/code.php?t='+new Date();"/>
      </div>
    </div>
    <?php }?>
    <div class="so_boxes">
      <input type="submit" name="button" class="buts" id="sub" value="立即查询">
    </div>
    <div class="so_boxex" id="tishi">
      说明:【<?php echo $tiaojian1;?><?php if($ismas=="1"){ ?>+验证码<?php }?>】都输入正确才显示相应结果。

    </div>
    <div id="tishi1" style="display:none;">请输入<?php echo $tiaojian1;?></div>
    <div id="tishi4" style="display:none;">认真输入4数字验证码</div>
</form>
<?php } else {
  if($ismas=="1"){
    session_start();
    if($codes!=$_SESSION['PHP_M2T']){
      webalert("请正确输入验证码！");
    }
  }
  if(!$shuru1){
    webalert("请输入$tiaojian1!");
  }

  if(!file_exists($file_qd_all)){
    webalert('请检查数据库文件');
  }

// echo '<p align="center"> ' . $shujus . '</p>';


$filer = fopen($file_qd_all, "r") or  webalert('无法打开文件!');
echo '<!--startprint--><table class="table table-sm table-bordered">';
echo '<caption>查询结果</caption>';
while(!feof($filer)){
    $ii++;
$rows=fgets($filer);
$rows=trim($rows);
if($rows){
    
    $tabvs=explode("\t",$rows);
    if("_".$shuru1=="_".$tabvs[1]){
    //echo "<!-- $shuru1 == $tabvs[$iaa] -->";
          $iae++; 
          $iaf=0; 
         echo '<tr>';
        foreach($tabvs as $tabu){
          $iaf++; 
          $iag=$iaf-1;
           // echo '<td class="r">'.$tabvt["$iag"].'</td>';
            echo '<td >'.$tabu.'</td>';
       }
        echo '</tr>';
    }

}
}
if($iae<1){
    echo '<tr>';
  echo "<td colspan=$io>没有查询到$tiaojian1 = $shuru1 相关信息哦</td>";
    echo '</tr>';
}
echo '</table>';
echo '<!--endprint-->';
fclose($filer);
?><div class="so_boxesd">
<input type="button" name="print" value="预览并打印" onclick="preview()" class="buts">
<input type="button" value="返 回" class="buts" onclick="location.href='?t=back';" id="reset"></div>
<?php 

}
$etime=microtime(true);//获取程序执行结束的时间
$total=$etime-$stime;   //计算差值
echo "<!----页面执行时间：{$total} ]秒--->";
?></div>
<div class="foot">
  <div class="title">
    <span>&copy;<?php echo date('Y');?>&nbsp; <a href="<?php echo $copyu;?>" target="_blank"><?php echo $copyr;?></a></span>
  </div>
</div>
</body>
</html>
